-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #2828 - AbstractHTTP2ServerConnectionFactory concurrent connect low performance. #2831
Fixes #2828 - AbstractHTTP2ServerConnectionFactory concurrent connect low performance. #2831
Conversation
… low performance. Now HTTP/2 sessions are not added to the Jetty component tree, but rather just held by HTTP2SessionContainer that is added to the Jetty container tree at startup. HTTP2SessionContainer uses a concurrent Set to hold HTTP/2 sessions to have good add/remove performance. Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
addManaged((LifeCycle)((HTTP2Connection)connection).getSession()); | ||
Session session = ((HTTP2Connection)connection).getSession(); | ||
sessions.add(session); | ||
LifeCycle.start(session); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if start throws an exception, will onClosed be called to remove it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Historically, if an exception was thrown from a Connection.Listener
we let it unwind the stack, which I don't think it's ideal.
I think such listeners should be wrapped in try/catch
, log the exception and continue.
So either we wrap, or we leave it as is. I'm for wrapping.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
log and continue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than my quibbles, LGTM
@@ -245,18 +252,43 @@ protected ServerParser newServerParser(Connector connector, ServerParser.Listene | |||
return new ServerParser(connector.getByteBufferPool(), listener, getMaxDynamicTableSize(), getHttpConfiguration().getRequestHeaderSize()); | |||
} | |||
|
|||
private class ConnectionListener implements Connection.Listener | |||
private class HTTP2SessionContainer implements Connection.Listener, Dumpable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make this a ManagedObject
and dump()
a ManagedOperation
, so we can dump just the sessions from JMX. Also make the size of the sessions collection a managed attribute.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good suggestions, will do.
… low performance. Improved JMX for the HTTP2SessionContainer. Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Now HTTP/2 sessions are not added to the Jetty component tree,
but rather just held by HTTP2SessionContainer that is added to
the Jetty container tree at startup.
HTTP2SessionContainer uses a concurrent Set to hold HTTP/2 sessions
to have good add/remove performance.
Signed-off-by: Simone Bordet simone.bordet@gmail.com